package com.jbm.onehome.iface;


import com.jbm.core.iface.IAcross;
import org.hibernate.annotations.OptimisticLockType;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * Created by lyh on 2017-04-07.
 */
@Entity
@Table(name = "capital_acc", schema = "", catalog = "")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true, optimisticLock = OptimisticLockType.VERSION )


  public class CapitalAccEntity extends IAcross
{
    private static final long serialVersionUID = -2087393250323494960L;
    @Transient
    public boolean back;
    @Transient
    public String method;
    @Transient
    public String errorinfo;
    @Transient
    public int count;
    @Transient
    public int start=0;
    @Transient
    public int pagesize=0;
    @Transient
    public Integer tableid;
    private int caId;
    private BigDecimal amount;
    private int accId;
    private String accType;
    private String caccType;
    private String aliAccount;
    private String mmOpenid;
    private String password;
    private Integer version;

	public CapitalAccEntity()
	{
		super();
	}

	public CapitalAccEntity(IAcross ia)
	{
		super(ia);
	}

    @Id
    @Column(name = "ca_id")
    @GeneratedValue
    public int getCaId() {
        return caId;
    }

    public void setCaId(int caId) {
        this.caId = caId;
    }

    @Basic
    @Column(name = "amount", precision = 2)
    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    @Basic
    @Column(name = "acc_id")
    public int getAccId() {
        return accId;
    }

    public void setAccId(int accId) {
        this.accId = accId;
    }

    @Basic
    @Column(name = "acc_type" )
    public String getAccType() {
        return accType;
    }

    public void setAccType(String accType) {
        this.accType = accType;
    }

    @Basic
    @Column(name = "cacc_type" )
    public String getCaccType() {
        return caccType;
    }

    public void setCaccType(String caccType) {
        this.caccType = caccType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CapitalAccEntity that = (CapitalAccEntity) o;

        if (accId != that.accId) return false;
        if (amount != that.amount) return false;
        if (caId != that.caId) return false;
        if (accType != null ? !accType.equals(that.accType) : that.accType != null) return false;
        if (caccType != null ? !caccType.equals(that.caccType) : that.caccType != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = caId;

        result = 31 * result + accId;
        result = 31 * result + (accType != null ? accType.hashCode() : 0);
        result = 31 * result + (caccType != null ? caccType.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "ali_account" )
    public String getAliAccount() {
        return aliAccount;
    }

    public void setAliAccount(String aliAccount) {
        this.aliAccount = aliAccount;
    }

    @Basic
    @Column(name = "mm_openid" )
    public String getMmOpenid() {
        return mmOpenid;
    }

    public void setMmOpenid(String mmOpenid) {
        this.mmOpenid = mmOpenid;
    }

    @Basic
    @Column(name = "password" )
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }


    @Version
    @Column(name = "version" )
    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }
}
